<?php
	// 使用演示
    include_once("buildEmail.php");
    include_once("emailFormat.php");
    include_once("batch_create_xml_email.php");
    
	$current_date=date("Ymd");
	$yestoday_date=date("Ymd",(time()-24*60*60));
	$email_content=file_get_contents("/var/log/email_dealing/email_count.$current_date");
	
	$to_list=array(0=>array('to_name'=>'wgzhou','to_email'=>'wgzhou@ux168.com'));
	$email_subject=$yestoday_date.' host 25 sent email statistic report';
	$from_name="send email server";
	$from_email='systemreport@ux168.com';
	$reply_to_name="send email server";
	$reply_to_email='systemreport@ux168.com';
	$sending_account_id='sourcingmap_pr';
	$emailFileNamePrefix='host25_sent_email_count';
	
	
	$buildEmailObject=new buildEmail($to_list,$email_subject,$email_content,$from_name,$from_email,$reply_to_name,$reply_to_email,
			                     $sending_account_id);
	
	$buildEmailObject->saveEmail($emailFileNamePrefix,"/var/email/salebo/default/sending/");
	
	// batch create
	$batchEmail = new BatchBuildXMLEmail();
	$batchEmail->initialParams(
			array('fromName'=>$from_name, 'fromEmail'=>$from_email, 'emailListId' => $sending_account_id, 
				'xmlPre'=>$emailFileNamePrefix, 'xmlDir'=>'/var/email/salebo/default/sending/'));
	// foreach(){
	$createEmail = $batchEmail->buildXMLEmail($toInfoArray,$emailSubject,$emailContent);
	// }
	
	// batch create with attachment
	// foreach (){ 
	$attachList = array('attachName1'=>'/to/your/path/filenam1', );
	$createEmail = $batchEmail->buildXMLEmailWithAttachments($toInfoArray,$emailSubject,
								$emailContent, $attachList);
	// }


?>
